package wordroid.activitys;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import java.io.PrintStream;
import java.util.ArrayList;
import wordroid.database.DataAccess;
import wordroid.model.Word;
import wordroid.model.WordList;

public class Test extends Activity
{
  ArrayList<Word> allList;
  int allListLength;
  Button attention;
  int currentId;
  DataAccess dataAccess;
  boolean isCheck;
  ArrayList<Word> list;
  int listLength;
  RadioGroup meaning;
  RadioButton meaning0;
  RadioButton meaning1;
  RadioButton meaning2;
  RadioButton meaning3;
  Button nextBtn;
  int[] opt;
  Button overBtn;
  int[] rand;
  int rightAns;
  int score = 0;
  TextView spelling;
  Toast toast;
  WordList wordList;
  int wordListInt;

  public void DisplayToast(String paramString)
  {
    this.toast = Toast.makeText(this, paramString, 0);
    this.toast.show();
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903057);
    this.wordListInt = (1 + Integer.parseInt(getIntent().getStringExtra("wordList")));
    setTitle("测试LIST-" + this.wordListInt);
    this.dataAccess = new DataAccess(this);
    this.allList = this.dataAccess.QueryWord(null, null);
    this.list = this.dataAccess.QueryWord("LIST='" + this.wordListInt + "'", null);
    this.listLength = this.list.size();
    this.allListLength = this.allList.size();
    System.out.println("listLength2 " + this.listLength);
    this.rand = random();
    this.spelling = ((TextView)findViewById(2131165249));
    Typeface localTypeface = Typeface.createFromAsset(getAssets(), "fonts/SEGOEUI.TTF");
    this.spelling.setTypeface(localTypeface);
    this.meaning = ((RadioGroup)findViewById(2131165250));
    this.meaning0 = ((RadioButton)findViewById(2131165251));
    this.meaning1 = ((RadioButton)findViewById(2131165252));
    this.meaning2 = ((RadioButton)findViewById(2131165253));
    this.meaning3 = ((RadioButton)findViewById(2131165254));
    this.nextBtn = ((Button)findViewById(2131165255));
    this.overBtn = ((Button)findViewById(2131165256));
    this.overBtn.setVisibility(8);
    new DisplayMetrics();
    int i = getApplicationContext().getResources().getDisplayMetrics().widthPixels;
    this.nextBtn.setWidth(i / 2);
    this.overBtn.setWidth(i / 2);
    this.attention = ((Button)findViewById(2131165257));
    this.attention.setWidth(i / 2);
    /*this.attention.setOnClickListener(new 1(this));
    this.overBtn.setOnClickListener(new 2(this));
    productQues(this.rand[this.currentId]);
    this.meaning.setOnCheckedChangeListener(new 3(this));
    this.nextBtn.setOnClickListener(new 4(this));*/
  }

  public int[] options(String paramString)
  {
    int i = Integer.parseInt(paramString);
    int[] arrayOfInt = new int[4];
    int j = 0;
    /*label12:*/ int l;
    if (j >= 4)
      l = 1;
    for (int i1 = 0; ; ++i1)
    {
      if (i1 >= 4);
      while (true)
      {/*
        if (l != 0)
        {
          this.rightAns = (int)(4.0D * Math.random());
          arrayOfInt[this.rightAns] = (i - 1);
        }
        return arrayOfInt;
        arrayOfInt[j] = (int)(Math.random() * this.allList.size());
        if (j > 0);
        for (int k = 0; ; ++k)
        {
          if (k >= j);
          while (true)
          {
            ++j;
            break label12:
            if (arrayOfInt[k] != arrayOfInt[j])
              break;
            --j;
          }
        }
        if (arrayOfInt[i1] != i - 1)
          break;
        l = 0;*/
      }
    }
  }

  public void productQues(int paramInt)
  {
    Word localWord = (Word)this.list.get(paramInt);
    this.opt = options(localWord.getID());
    this.spelling.setText(localWord.getSpelling() + " " + localWord.getPhonetic_alphabet());
    this.meaning0.setText(((Word)this.allList.get(this.opt[0])).getMeanning());
    this.meaning1.setText(((Word)this.allList.get(this.opt[1])).getMeanning());
    this.meaning2.setText(((Word)this.allList.get(this.opt[2])).getMeanning());
    this.meaning3.setText(((Word)this.allList.get(this.opt[3])).getMeanning());
    this.meaning.clearCheck();
    this.meaning0.setEnabled(true);
    this.meaning1.setEnabled(true);
    this.meaning2.setEnabled(true);
    this.meaning3.setEnabled(true);
    this.nextBtn.setVisibility(8);
    this.attention.setVisibility(8);
    this.isCheck = true;
  }

  public int[] random()
  {
	return null;/*
    int[] arrayOfInt = new int[this.listLength];
    int i = 0;
    label9: int j;
    if (i >= this.listLength)
    {
      j = 0;
      if (j < this.listLength)
        break label51;
    }
    for (int i1 = 0; ; ++i1)
    {
      if (i1 >= this.listLength)
      {
        return arrayOfInt;
        arrayOfInt[i] = i;
        ++i;
        break label9:
        label51: int k = arrayOfInt[j];
        int l = (int)(Math.random() * this.listLength);
        arrayOfInt[j] = arrayOfInt[l];
        arrayOfInt[l] = k;
        ++j;
      }
      System.out.println(arrayOfInt[i1]);
    }*/
  }
}

/* Location:           E:\Desktop\Android\英语词汇记忆\classes_dex2jar.jar
 * Qualified Name:     wordroid.activitys.Test
 * JD-Core Version:    0.5.3
 */